function Api() {
  //构造函数
  function Api() {
    return this;
  }


  //let url = "http://www.md.com";
  let url = "https://wechat-auth.1miaodao.cn";

  // 获取个人信息
  Api.prototype.getOpenId = url + "/api/token/user";
  // 编辑个人资料
  Api.prototype.modifyUserInfo = url + "/wx/saveUserInfo";
  // 首页控件请求
  Api.prototype.getHomeFarem = url + "/wx/getHomeFrame";
  // 获取个人信息
  Api.prototype.getUserInfo = url + "/wx/getUserInfo";
  // 手机号解析
  Api.prototype.decodePhone = url + "/wx/decodePhone";
  // 我的优惠券
  Api.prototype.getMyCoupon = url + "/wx/coupon/getMyCoupon";
  // 我的优惠券 
  Api.prototype.getCanUseCoupons = url + "/wx/coupon/getCanUseCoupons";
  // 商家的优惠券
  Api.prototype.getTenantCoupon = url + "/wx/coupon/getTenantCoupon";
  //用户开通会员卡
  Api.prototype.openMembercard = url + "/user/openMembercard";

  // 商家的会员
  Api.prototype.getTenantMemberType = url + "/wx/member/getTenantMemberType";
  // 我的会员
  Api.prototype.getUserMemberType = url + "/wx/member/getUserMemberType";
  // 文章列表
  Api.prototype.getArticle = url + "/wx/article/getArticle";
  // 文章详情
  Api.prototype.getArticleDetail = url + "/wx/article/getArticleDetail";
  // 分销规则
  Api.prototype.getSaleRule = url + "/wx/sale/getSaleRule";
  // 分销绑定上级用户关系
  Api.prototype.bindUser = url + "/api/user/BindUser";
  //当面付
  Api.prototype.faceOrder = url + "/wx/face/createOrder";


  // 获取商品分类
  Api.prototype.getProductGroup = url + "/wx/product/getProductClass";
  // 商品列表
  Api.prototype.getProductList = url + "/wx/product/getProductList";
  // 获取商品分类价格
  Api.prototype.getProductPrice = url + "/wx/product/getProductPrice";
  // 商品详情
  Api.prototype.getProductDetails = url + "/wx/product/getProductDetails";
  //Api.prototype.getProductDetails = url + "/wx/product/getGoodsDetails";
  //门店列表
  // Api.prototype.storeSort = url + '/wx/store/getStoreSort';
  //门店详情
  Api.prototype.storeDetails = url + '/wx/store/getStoreDetails';
  //查找店铺信息
  // Api.prototype.storeList = url + '/wx/store/getStoreSort';
  //获取距我最近的店铺
  Api.prototype.nearbyStore = url + '/wx/store/getNearbyStore';
  //店铺搜索
  Api.prototype.searchStore = url + '/wx/store/searchStore'
  //获取积分规则
  Api.prototype.integralRule = url + '/wx/integral/getIntegralRule';
  //积分商品列表
  Api.prototype.integiftList = url + '/wx/integral/getIntegralProduct';
  //积分商品详情 /wxconf/integift/integralDetails
  // Api.prototype.integralDetails = url + '/wx/integral/integralDetails';
  //积分明细
  Api.prototype.integralList = url + '/wx/integral/getIntegralRecord';
  //查看订单
  Api.prototype.getOrder = url + '/wx/order/getOrder';
  //查看订单详情
  Api.prototype.getOrderDetails = url + '/wx/order/getOrderDetails';
  //创建订单
  Api.prototype.order = url + '/createorder';
  //生成预订单号
  Api.prototype.getOrderId = url + '/api/order/getOrderId'
  //获取达达配送运费
  Api.prototype.queryDeliverFee = url + '/api/order/queryDeliverFee'
  //支付
  Api.prototype.preOrder = url + '/api/pay/pre_order'
  //余额支付
  Api.prototype.balance = url + '/api/pay/balance'

  //当面付支付
  Api.prototype.offlineWechat = url + '/api/pay/offlineWechat';
  //当面付余额支付
  Api.prototype.offlineBalance = url + '/api/pay/offlineBalance';

  //配送费
  Api.prototype.getTenantDistribution = url + '/wx/tenant/getTenantDistribution'
  
  //获取名店所支持的配送方式配送费
  Api.prototype.getTenantDistributionType = url + '/api/tenant/getTenantDistributionType'
  
  // 购物车列表
  Api.prototype.getShoppingCartList = url + "/wx/getMyShopingCars";
  // 添加修改购物车
  Api.prototype.addShoppingCart = url + "/api/shoppingCar/add_or_update_shoppingCar";
  //修改购物车数量
  // Api.prototype.modifyShoppingCar = url + "/shop/product/modifyShoppingCar";
  // 删除购物车
  Api.prototype.delShoppingCart = url + "/api/shoppingCar/delShoppingCar";
  // 生成积分订单
  //Api.prototype.createOrder = url + "/user/order/createOrder1";
  Api.prototype.createOrder = url + "/api/Integralexchange";
  //拼团列表
  Api.prototype.groupList = url + '/api/getGroupList';
  //拼团 用户开/参 团详情
  Api.prototype.SpellGroupDetail = url + '/api/getGroupDetails';
  //用户开团或参团
  Api.prototype.MakeGroup = url + '/api/MakeGroup';
  //开团支付完成之后调用
  //Api.prototype.openSpellGroups = url + '/wxconf/group/openSpellGroups';
  //我的已开团/参团
  Api.prototype.mySpellGroups = url + '/api/myGroups';
  // //我的已开团/参团详情
  Api.prototype.myGroupDetails = url + '/api/myGroupDetails';

  // 帐户支付
  Api.prototype.accountPay = url + "/user/pay/accountPay";
  // 微信支付
  //Api.prototype.wxPay = url + "/pay/pre";
  Api.prototype.wxPay = url + "/pay/preOne";
  // 帐户充值接口
  Api.prototype.recharge = url + "/user/createrecharge";
  //  微信充值接口
  Api.prototype.wxRecharge = url + '/user/Paymentrecharge';
  // 明细列表
  Api.prototype.getBills = url + "/user/purchasehistory";

  // 认确收货
  Api.prototype.endOrder = url + "/api/order/ConfirmGoods";
  //售后
  //Api.prototype.orderReturn = url + '/user/orderReturn';
  Api.prototype.orderReturn = url + '/api/Order/refund';
  // 取消订单售后
  Api.prototype.cancelrefund = url + "/api/Order/cancelrefund";

  //售后图片上传
  Api.prototype.orderload = url + '/api/uploadfile';

  //提交退货物流
  Api.prototype.orderReturnEx = url + '/user/orderReturnEx';
  // 售后列表
  Api.prototype.getRefundOrderList = url + '/user/order/getRefundOrderList';
  // 售后详情
  Api.prototype.getRefundOrderDetail = url + '/user/order/getRefundOrderDetail';

  // 全部订单
  //Api.prototype.getOrderList = url + "/user/order/getOrderList";
  Api.prototype.getOrderList = url + "/user/order/getOrderList23";
  // 取消订单
  Api.prototype.delOrder = url + "/api/Order/cancelOrder";
  
  // 更新订单
  //Api.prototype.modifyOrder = url + "/user/order/modifyOrder1";
  Api.prototype.modifyOrder = url + "/user/order/modifyOrder2";

  // 收货地址
  Api.prototype.getAddressList = url + "/user/user/getAddressList";
  // 编辑收货地址
  Api.prototype.modifyAddress = url + "/user/user/modifyAddress";
  // 删除收货地址
  Api.prototype.delAddress = url + "/user/user/delAddress";
  //请求默认收货地址
  Api.prototype.defualtAddress = url + "/user/defualtAddress";

  // 修改手机号
  Api.prototype.modifyMobile = url + "/user/user/modifyMobile";
  // 商家优惠券列表
  // Api.prototype.getTenntCouponList = url + "/wxconf/coupon/getTenntCouponList";
  // 我的优惠券列表
  // Api.prototype.getCouponList = url + "/wxconf/coupon/getCouponList";
  // 弹屏优惠券列表
  Api.prototype.getCoupon = url + "/wx/getHomeAdvertisment";
  // 领取优惠券
  Api.prototype.receiveCoupon = url + "/wx/coupon/receiveCoupon";
  // 当前商品可使用优惠券
  // Api.prototype.canUseCouponList = url + "/wxconf/coupon/canUseCouponList23";
  
  // 单个明细
  Api.prototype.getBillDetails = url + "/user/user/getBillDetails";

  //绑定上级商户ID
  Api.prototype.bindUserFormQRcode = url + '/api/user/BindUser';
  //用户预计收益
  Api.prototype.Userexea = url + "/api/user/Userexea"; 
  //用户实际收益
  Api.prototype.Usereain = url + "/api/user/RealIncome"; 

  //提现到帐记录
  Api.prototype.Presentrecord = url + "/api/user/Presentrecord";
  // 获取邀请的下级列表
  Api.prototype.getSaleInfo = url + "/api/Sale/getSubordinateList";
  //提交申请佣金提现
  Api.prototype.applyWithdrawals = url + "/api/Sale/PutforwardApply";
  //商户向提现用户打款
  Api.prototype.MakeMoney = url + "/api/Sale/MakeMoney";

  //申请佣金列表
  // Api.prototype.getCommissionRecord = url + "/wxconf/distribution/getCommissionRecord";
  //统计分享受
  Api.prototype.updateFxcs = url + "/user/updateFxcs";
  Api.prototype.upload = url + '/user/mng/upload';
  
  //绑定微信的手机号
  Api.prototype.wxphone = url + '/user/mng/wxphone';
  //到店扫码
  //Api.prototype.end = url + '/user/order/end';
  Api.prototype.end = url + '/api/order/WriteOff';
  
  // // 获取拼团规则
  // Api.prototype.groupRule = url + '/wxconf/group/groupRule';
  
  
  // 签到
  Api.prototype.signSendIntegral = url + '/wxconf/sign/signSendIntegral';
  // 签到状态
  // Api.prototype.isSign = url + '/wxconf/sign/isSign';
  // 保存formId
  Api.prototype.saveFormId = url + '/user/mng/formId';
  // 发送优惠券通知
  // Api.prototype.sendCoupn = url + '/wxconf/coupon/sendCoupn';

  // 查看快递物流详情
  Api.prototype.logistics = url + '/api/order/getLogistics';
  // 达达配送物流跟踪
  Api.prototype.dada = url + '/api/dada/LT';
  



  // 个人会员信息接口
  Api.prototype.getPersonMember = url + '/member/getPersonMember';
  // 会员信息
  Api.prototype.getPersonMemberType = url + '/member/getPersonMemberType';
  // 商户所有会员类型，会员规则接口
  Api.prototype.getTenantMemberRule = url + '/member/getTenantMemberRule';


  return new Api();
}

module.exports = {
  Api: Api
}